<%@ page import="entity.User" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/9/9
  Time: 13:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<%
  User user = (User) session.getAttribute("user");
  if(user==null){
%>
<a href="">注册</a>
<a href="<%=request.getContextPath()%>/jsp/login2.jsp">登录</a>
<% }else{ %>
<h1>欢迎<%=user.getUsername()%>来到主页</h1>
<a href="<%=request.getContextPath()%>/logout.code">注销</a>
<% } %>
</body>
</html>
